

var ssopts = {
	init: function() {
		var tc = SS_getPreference(SMACK_TCHL1);
		var bc = SS_getPreference(SMACK_BTCHL1);
		ssopts.updateSample(tc,bc);
		/*
		var cpicker = document.getElementById('tcolorpic1');
		var cpicker2 = document.getElementById('bkcolorpic1');
		
		
		var usercolor = SS_getPreference(SMACK_TCHL1);
		cpicker.color = usercolor;
		usercolor = SS_getPreference(SMACK_BTCHL1);
		cpicker2.color = usercolor;
		*/
		
	},
	updateTextColor: function() {
		var cpicker = document.getElementById('tcolorpic1');
		var textColor = document.getElementById('textstringpref_hltextcolor1');
		textColor.value = cpicker.color;
		ssopts.updateSample(textColor.value, null);
	},
	updateBackgroundColor: function() {
		var cpicker = document.getElementById('bkcolorpic1');
		var textColor = document.getElementById('textstringpref_hlbkcolor1');
		textColor.value = cpicker.color;
		ssopts.updateSample(null, textColor.value);
	},
	textboxColorChange: function(event) {
		var textColor = event.target;
		var newcolor;
		if (textColor.id == 'textstringpref_hlbkcolor1') {
		var cpicker = document.getElementById('bkcolorpic1');
		cpicker.color = textColor.value;
		ssopts.updateSample(null, textColor.value);
		}
		else if(textColor.id == 'textstringpref_hltextcolor1') {
			var cpicker = document.getElementById('tcolorpic1');
			cpicker.color = textColor.value;
			ssopts.updateSample(textColor.value,null);
		}
		
	},
	themeColorChange: function(textColor,backgroundColor) {
		document.getElementById('textstringpref_hltextcolor1').value = textColor;
		SS_prefs.setCharPref(SMACK_TCHL1,textColor);
		document.getElementById('textstringpref_hlbkcolor1').value = backgroundColor;
		SS_prefs.setCharPref(SMACK_BTCHL1,backgroundColor);
		ssopts.updateSample(textColor,backgroundColor);
	},
	updateSample: function(tc, bc) {
		var l = document.getElementById('hlSampleText');
		if (tc != null) l.style.color=tc;
		if (bc != null) l.style.background=bc;
	}
} //end ssopts
